<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="videoDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='videoDetail.heading'/>"/>
    <sx:head />
</head>

<c:set var="delObject" scope="request"><fmt:message key="videoList.video"/></c:set>
<script type="text/javascript">var msgDelConfirm =
   "<fmt:message key="delete.confirm"><fmt:param value="${delObject}"/></fmt:message>";
</script>

<div class="span2">
    <h2><fmt:message key="videoDetail.heading"/></h2>
    <fmt:message key="videoDetail.message"/>
</div>

<div class="span7">
    <s:form id="videoForm" action="saveVideo" method="post" validate="true" cssClass="well form-horizontal">
    	<s:hidden key="video.id"/>
        <fieldset class="control-group">
    	<label class="control-label"> PostDate: </label>
    	<div class="controls">
    	<sx:datetimepicker  required="true" name="video.postDate" value="video.postDate"/>
    	<sx:datetimepicker  required="true" name="hourformat" value="hourformat" type="time" displayFormat="HH:mm:ss"/>
    	</div>
		</fieldset>
		<s:select required = "true" name="video.systemuser.id" list="systemuserList" listKey="id" listValue="name"   label="Systemusers"></s:select>		
    	<c:if test="${not empty video.id}">
    	<fieldset class="control-group">
    	<label class="control-label">  </label>
    	<div class="controls">
    			<a href="editSystemuser?id=<c:out value="${video.systemuser.id}"/>">View <c:out value="${video.systemuser.name}"/></a>
    	</div>
		</fieldset>
		 </c:if>
        <s:textfield key="video.title" required="true" maxlength="100" />
        <s:textfield key="video.viewTimes" required="true" maxlength="255" />
        <s:textarea key="video.description" required="true" maxlength="1000" id="Content" cssStyle="width: 475px; height: 151px;"/>       
        <s:textfield key="video.youtubeUrl" required="true" maxlength="300" />

        <div id="actions" class="form-actions">
            <s:submit type="button" cssClass="btn btn-primary" method="save" key="button.save" theme="simple">
                <i class="icon-ok icon-white"></i> <fmt:message key="button.save"/>
            </s:submit>
            <c:if test="${not empty video.id}">
                <s:submit type="button" cssClass="btn btn-warning" method="delete" key="button.delete"
                    onclick="return confirmMessage(msgDelConfirm)" theme="simple">
                    <i class="icon-trash icon-white"></i> <fmt:message key="button.delete"/>
                </s:submit>
            </c:if>
            <s:submit type="button" cssClass="btn" method="cancel" key="button.cancel" theme="simple">
                <i class="icon-remove"></i> <fmt:message key="button.cancel"/>
            </s:submit>
        </div>
    </s:form>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $("input[type='text']:visible:enabled:first", document.forms['videoForm']).focus();
    });
</script>
